# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=glib-networking
pkgver=2.78.0
pkgrel=0
pkgdesc="Networking support for GLib"
url="https://gitlab.gnome.org/GNOME/glib-networking"
arch="all"
license="LGPL-2.0-or-later"
depends="ca-certificates gsettings-desktop-schemas"
makedepends="
	bash
	glib-dev
	gnutls-dev
	gsettings-desktop-schemas-dev
	libgcrypt-dev
	libproxy-dev
	meson
	p11-kit-dev
	"
subpackages="$pkgname-dbg $pkgname-lang"
source="https://download.gnome.org/sources/glib-networking/${pkgver%.*}/glib-networking-$pkgver.tar.xz"
options="!check" # new p11-kit makes a few of these fail, run them next release

# secfixes:
#   2.64.3-r0:
#     - CVE-2020-13645

build() {
	abuild-meson \
		-Db_lto=true \
		-Dopenssl=disabled \
		-Dgnutls=enabled \
		. build
	meson compile -C build
}

check() {
	meson test --no-rebuild --print-errorlogs -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
7574e82aa018332edf99dd284c7fd74b5935bca4a6a70e950ae4b22bbe7be188433fea69e35c742cae120e7ff7d1a6b4f5bf3957fc31f220f50189d3958a3f58  glib-networking-2.78.0.tar.xz
"
